package cn.howxu.yichen_ovo.datagen;

import cn.howxu.yichen_ovo.Res;
import cn.howxu.yichen_ovo.YiChenOVO;
import cn.howxu.yichen_ovo.common.item.EGG;
import cn.howxu.yichen_ovo.init.ModItems;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.*;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.item.Items;
import net.minecraftforge.common.Tags;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.ForgeRegistries;

import java.util.List;
import java.util.function.Consumer;

/**
 * @description: TODO
 * @author: HowXu
 * @date: 2025/9/12 18:05
 */
public class RecipesGenerator extends RecipeProvider {

    public RecipesGenerator(PackOutput packOutput) {
        super(packOutput);
    }

    @Override
    protected void buildRecipes(Consumer<FinishedRecipe> consumer) {
        // 合成冷蛋
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.COLDEGG.get(), 4)
                .group(YiChenOVO.MODID)
                .pattern(" A ")
                .pattern("ABA")
                .pattern(" A ")
                .define('A', Items.EGG)
                .define('B', Items.SNOWBALL)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer, Res.rl("cold_egg1"));

        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.COLDEGG.get(), 8)
                .group(YiChenOVO.MODID)
                .pattern("AAA")
                .pattern("ABA")
                .pattern("AAA")
                .define('A', Items.EGG)
                .define('B', Items.SNOWBALL)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer, Res.rl("cold_egg2"));

        // 合成ATM之星
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.ATMStar.get(), 1)
                .group(YiChenOVO.MODID)
                .pattern(" A ")
                .pattern("ABA")
                .pattern("CAC")
                .define('A', Items.IRON_INGOT)
                .define('B', Items.DIAMOND)
                .define('C', Items.EGG)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);

        // 合成灯牌 1
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.DENGPAI.get(), 1)
                .group(YiChenOVO.MODID)
                .pattern("AAA")
                .pattern("ABA")
                .pattern("AAA")
                .define('A', Items.DIAMOND_BLOCK)
                .define('B', Items.GOLD_BLOCK)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer, Res.rl("dengpai1"));

        // 合成灯牌 2
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.DENGPAI.get(), 4)
                .group(YiChenOVO.MODID)
                .pattern(" A ")
                .pattern("ABA")
                .pattern(" A ")
                .define('A', Items.GLOWSTONE_DUST)
                .define('B', Items.PAPER)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer, Res.rl("dengpai2"));

        // 合成烤洋芋
        oreSmelting(consumer, //照着写就行
                List.of(Items.BAKED_POTATO),//原物品
                RecipeCategory.MISC,//合成表分类
                ModItems.YangYuBa.get(),//原物品烧完得到的东西
                1f,//烧完获得的经验
                100,//烧完需要的时间
                YiChenOVO.MODID);//mod分类还是写我们的odid就行

        // 合成me控制器
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.CRAFTING.get(), 1)
                .group(YiChenOVO.MODID)
                .pattern("CAC")
                .pattern("ABA")
                .pattern("CDC")
                .define('C', Items.OBSIDIAN)
                .define('B', Items.DIAMOND)
                .define('A', Items.REDSTONE)
                .define('D', Items.EGG)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);

        // 合成疏导元件
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.UL.get(), 1)
                .group(YiChenOVO.MODID)
                .pattern("CAC")
                .pattern("ABA")
                .pattern("CDC")
                .define('C', Items.STONE)
                .define('B', Items.OBSIDIAN)
                .define('A', Items.REDSTONE)
                .define('D', Items.EGG)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);

        // 合成256M元件
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MEGACELL.get(), 1)
                .group(YiChenOVO.MODID)
                .pattern("ABA")
                .pattern("CDC")
                .pattern("ECE")
                .define('A', Items.GLASS)
                .define('B', Items.REDSTONE)
                .define('D', Items.DIAMOND)
                .define('C', Items.CHEST)
                .define('E', Items.EGG)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);

        // 合成科技佬
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("kejilao")), 8)
                .group(YiChenOVO.MODID)
                .requires(ModItems.ATMStar.get())
                .requires(ModItems.UL.get())
                .requires(ModItems.MEGACELL.get())
                .requires(ModItems.CRAFTING.get())
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);

        // 合成冷蛋的科技佬
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("cold_kejilao")), 8)
                .group(YiChenOVO.MODID)
                .pattern("AAA")
                .pattern("ABA")
                .pattern("AAA")
                .define('A', ForgeRegistries.ITEMS.getValue(Res.rl("kejilao")))
                .define('B', ModItems.COLDEGG.get())
                .unlockedBy("has_cold_dan", has(ModItems.COLDEGG.get()))
                .save(consumer);

        // 合成忆宸OVO 1
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm")), 8)
                .group(YiChenOVO.MODID)
                .pattern("AAA")
                .pattern("ABA")
                .pattern("AAA")
                .define('A', ForgeRegistries.ITEMS.getValue(Res.rl("cold_kejilao")))
                .define('B', ModItems.COLDEGG.get())
                .unlockedBy("has_cold_dan", has(ModItems.COLDEGG.get()))
                .save(consumer, Res.rl("yichen_mm1"));

        // 合成忆宸OVO 2
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm")), 8)
                .group(YiChenOVO.MODID)
                .pattern("AAA")
                .pattern("ABA")
                .pattern("AAA")
                .define('A', Items.EGG)
                .define('B', Items.TRIDENT)
                .unlockedBy("has_cold_dan", has(ModItems.COLDEGG.get()))
                .save(consumer, Res.rl("yichen_mm2"));

        // 合成忆宸OVO 3
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm")), 8)
                .group(YiChenOVO.MODID)
                .requires(Items.WITCH_SPAWN_EGG)
                .unlockedBy("has_cold_dan", has(ModItems.COLDEGG.get()))
                .save(consumer, Res.rl("yichen_mm3"));


        // 合成蛋忆宸
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_dan")), 1)
                .group(YiChenOVO.MODID)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm")))
                .requires(Items.EGG)
                .unlockedBy("subscribe_yichen_mm", has(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm"))))
                .save(consumer);

        // 合成女巫忆宸
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_nvwu")), 1)
                .group(YiChenOVO.MODID)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm")))
                .requires(Items.GLASS_BOTTLE)
                .requires(Items.BOOK)
                .unlockedBy("subscribe_yichen_mm", has(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm"))))
                .save(consumer);

        // 合成服务员忆宸
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_nvpu")), 1)
                .group(YiChenOVO.MODID)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm")))
                .requires(Items.APPLE)
                .unlockedBy("subscribe_yichen_mm", has(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm"))))
                .save(consumer);

        // 合成律师函忆宸
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_xixi")), 1)
                .group(YiChenOVO.MODID)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm")))
                .requires(Items.IRON_LEGGINGS)
                .unlockedBy("subscribe_yichen_mm", has(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm"))))
                .save(consumer);

        // 合成普信女忆宸
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_puxin")), 1)
                .group(YiChenOVO.MODID)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm")))
                .unlockedBy("subscribe_yichen_mm", has(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm"))))
                .save(consumer);

        // 合成天使忆宸 这里重写了因为人多了
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_angel")), 4)
                .group(YiChenOVO.MODID)
                .pattern("ABA")
                .pattern("BCB")
                .pattern("ABA")
                .define('B', ModItems.DENGPAI.get())
                .define('A', ModItems.EGG_1X.get())
                .define('C', ModItems.COLDEGG.get())
                .unlockedBy("has_cold_dan", has(ModItems.COLDEGG.get()))
                .save(consumer,Res.rl("yichen_angel1"));

        // 合成天使忆宸 这里重写了因为人多了
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_angel")), 4)
                .group(YiChenOVO.MODID)
                .pattern("AAA")
                .pattern("AAA")
                .pattern("AAA")
                .define('A', ModItems.EGG_9X.get())
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer,Res.rl("yichen_angel2"));

        // 合成叉出去忆宸
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_chachuqu")), 1)
                .group(YiChenOVO.MODID)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_angel")))
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("gotopark")))
                .unlockedBy("subscribe_yichen_mm", has(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm"))))
                .save(consumer);

        // 合成叉出去2 忆宸
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_chachuqu2")), 1)
                .group(YiChenOVO.MODID)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_angel")))
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("howxu")))
                .unlockedBy("subscribe_yichen_mm", has(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm"))))
                .save(consumer);

        // 合成炸了 忆宸
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yichen_zhale")), 1)
                .group(YiChenOVO.MODID)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm")))
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("big_yusen_pt")))
                .requires(Items.FISHING_ROD)
                .requires(ModItems.YangYuBa.get())
                .unlockedBy("subscribe_yichen_mm", has(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm"))))
                .save(consumer);

        // 合成情绪
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("howxu")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.IRON_INGOT)
                .define('A', Items.REDSTONE)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer,Res.rl("howxu1"));
        
        // 合成情绪2
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("howxu")), 1)
                .requires(ModItems.TIELI.get())
                .requires(ModItems.TIELI.get())
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer,Res.rl("howxu2"));
        
        

        // 合成空巷
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("gotopark")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.IRON_INGOT)
                .define('A', Items.DIAMOND)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成普通
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("gotopark_pt")), 1)
                .group(YiChenOVO.MODID)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("gotopark")))
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成无碍
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("bury_love")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.IRON_INGOT)
                .define('A', Items.GOLD_INGOT)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成普通
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("bury_love_pt")), 1)
                .group(YiChenOVO.MODID)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("bury_love")))
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成雨神
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("big_yusen")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.IRON_INGOT)
                .define('A', Items.IRON_SWORD)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成普通
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("big_yusen_pt")), 1)
                .group(YiChenOVO.MODID)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("big_yusen")))
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成雨神2
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("big_yusen2")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.IRON_INGOT)
                .define('A', Items.DIAMOND_SWORD)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成日记
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("riji_")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.WHITE_WOOL)
                .define('A', Items.IRON_INGOT)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成源曦
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yuanxi_19")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.WHITE_WOOL)
                .define('A', Items.REDSTONE_TORCH)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成随风摇
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("suifengyao")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.WHITE_WOOL)
                .define('A', Items.OAK_DOOR)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成谶
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("dchen233")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.WHITE_WOOL)
                .define('A', ModItems.EGG_1X.get())
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成YUJIAGE
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("yujiage")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.WHITE_WOOL)
                .define('A', Items.IRON_SWORD)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成XingYu233
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("xingyu233")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.WHITE_WOOL)
                .define('A', Items.POTATO)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);
        
        // 合成等风
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("ohana_1234")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.WHITE_WOOL)
                .define('A', Items.OAK_LEAVES)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成小y
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ForgeRegistries.ITEMS.getValue(Res.rl("xiao_y3")), 1)
                .group(YiChenOVO.MODID)
                .pattern("BBB")
                .pattern("BAB")
                .pattern("BBB")
                .define('B', Items.WHITE_WOOL)
                .define('A', Items.REDSTONE_BLOCK)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);
        
        // 唱片
        // 合成打瓦神曲
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.RECORD_WA.get(), 1)
                .group(YiChenOVO.MODID)
                .pattern(" B ")
                .pattern("BAB")
                .pattern(" B ")
                .define('B', ModItems.DENGPAI.get())
                .define('A', Items.IRON_INGOT)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成龙族之歌
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.RECORD_LZ.get(), 1)
                .group(YiChenOVO.MODID)
                .pattern(" B ")
                .pattern("BAB")
                .pattern(" B ")
                .define('B', Items.IRON_SWORD)
                .define('A', Items.END_STONE)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);
        
        // 合成铁粒
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.TIELI.get(), 2)
                .requires(ModItems.HEART.get())
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);
        // 合成算法导论
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.ALBOOK.get(), 1)
                .requires(ModItems.EGG_1X.get())
                .requires(ModItems.EGG_2X.get())
                .requires(Items.BOOK)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);
        
        // 合成寰宇支配之剑
        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.SWORD.get(), 1)
                .group(YiChenOVO.MODID)
                .pattern(" A ")
                .pattern(" A ")
                .pattern(" B ")
                .define('A', ModItems.TIELI.get())
                .define('B', ModItems.EGG_1X.get())
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);

        // 合成我为忆宸举大旗
        ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, ModItems.FLAG.get(), 1)
                .group(YiChenOVO.MODID)
                .pattern("ABA")
                .pattern("ABA")
                .pattern(" C ")
                .define('A', Items.WHITE_WOOL)
                .define('B', ModItems.EGG_1X.get())
                .define('C',Items.STICK)
                .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT))
                .save(consumer);
        
        // 合成8+1
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.WINE.get(), 4)
                .requires(Items.WATER_BUCKET)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("yuanxi_19")))
                .requires(Items.GLASS_BOTTLE)
                .requires(Items.GLASS_BOTTLE)
                .requires(Items.GLASS_BOTTLE)
                .requires(Items.ROSE_BUSH)
                .requires(ModItems.EGG_1X.get())
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);
        
        // 合成生成忆宸
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.SPAWN.get(), 16)
                .requires(Items.PORKCHOP)
                .requires(ModItems.EGG_1X.get())
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);
        
        // 合成舞一个
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.WYG.get(), 1)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("howxu")))
                .requires(ModItems.EGG_1X.get())
                .requires(Items.ROSE_BUSH)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);
        
        // 合成不呆画
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.BUDAI_PAINT.get(), 1)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("howxu")))
                .requires(ModItems.HEART.get())
                .requires(Items.ROSE_BUSH)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);

        // 合成不行了
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.BXL_PAINT.get(), 1)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm")))
                .requires(Items.IRON_SWORD)
                .requires(Items.PAPER)
                .requires(Items.PAPER)
                .requires(Items.PAPER)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);

        // looking in my eyes
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.EYE_PAINT.get(), 1)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm")))
                .requires(Items.ENDER_EYE)
                .requires(Items.ENDER_EYE)
                .requires(Items.PAPER)
                .requires(Items.PAPER)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);

        // OUT
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.OUT_PAINT.get(), 1)
                .requires(ForgeRegistries.ITEMS.getValue(Res.rl("yichen_mm")))
                .requires(Items.TNT)
                .requires(Items.PAPER)
                .requires(Items.PAPER)
                .requires(Items.PAPER)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);
        
        
        
        // 合成嘻嘻唱片
        // 合成龙族之歌
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.RECORD_SWEET.get(), 1)
                .group(YiChenOVO.MODID)
                .pattern(" B ")
                .pattern("BAB")
                .pattern(" B ")
                .define('B', Items.SUGAR)
                .define('A', ModItems.EGG_1X.get())
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);
        
        // 注册egg合成表
        regEggRecipes(consumer);
    }
    
    private void  regEggRecipes(Consumer<FinishedRecipe> consumer){
        int size = ModItems.EGGS.size();
        // 1x蛋不要
        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.EGG_1X.get(), 1)
                .group(YiChenOVO.MODID)
                .pattern("AAA")
                .pattern("AAA")
                .pattern("AAA")
                .define('A', Items.EGG)
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);
        // 2x及以上
        for(int i = 1;i< size;i++){
            ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.EGGS.get(i).get(), 1)
                    .group(YiChenOVO.MODID)
                    .pattern("AAA")
                    .pattern("AAA")
                    .pattern("AAA")
                    .define('A', ModItems.EGGS.get(i-1).get())
                    .unlockedBy("has_egg", has(Items.EGG))
                    .save(consumer);
        }
        // 反向释放
        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.EGG, 9)
                .group(YiChenOVO.MODID)
                .requires(ModItems.EGG_1X.get())
                .unlockedBy("has_egg", has(Items.EGG))
                .save(consumer);

        for(int i = size - 1 ; i > 0;i--){
            ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.EGGS.get(i-1).get(), 9)
                    .group(YiChenOVO.MODID)
                    .requires(ModItems.EGGS.get(i).get())
                    .unlockedBy("has_egg", has(Items.EGG))
                    .save(consumer,Res.rl("egg_"+ (i - 1) +"x2"));
        }
    }
}
